/*
 * Copyright © 2004-2014 chenYuan. All rights reserved.
 * @Website:wwww.jspx.net
 * @Mail:39793751@qq.com
 * @author: chenYuan , 陈原
 * @License: Jspx.net Framework Code is open source (LGPL)，Jspx.net Framework 使用LGPL 开源授权协议发布。
 * @jvm:jdk1.6+  x86/amd64
 *
 */
package com.jspx.txweb.online;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.*;
import java.io.Serializable;
import com.jspx.json.JSONObject;
import com.jspx.security.symmetry.Encrypt;
import com.jspx.txweb.Action;
import com.jspx.txweb.IMember;
import com.jspx.txweb.support.ActionSupport;
import com.jspx.txweb.table.UserSession;

/**
 * Created by IntelliJ IDEA.
 * User:chenYuan (mail:39793751@qq.com)
 * Date: 2005-8-4
 * Time: 11:39:53
 * com.jspx.txweb.online.OnlineUserManager
 */
public interface OnlineManager  extends Serializable
{

    String getDomain();
    void init() throws Exception;
    Encrypt getEncrypt();
    boolean isOnline(long uid);
    boolean isOnline(String sessionId);
    Map<String, String> getSafePrompt(long uid);
    void exit(String sessionId) throws Exception;
    JSONObject login(HttpSession session, String loginId, String password, int passwordEncoded, String client, String ip) throws Exception;
    Map<String, String> login(ActionSupport action,String isId, String loginId, String password, int passwordEncoded, int cookieSecond, int invisible) throws Exception;
    UserSession getUserSession(Action action) throws Exception;
    UserSession getUserSession(String sessionId) throws Exception;
    void deleteUserSession(String sid,long uid) throws Exception;
    String getCookieSessionId(HttpServletRequest request,HttpServletResponse response);
    IMember getGuest() throws Exception;
    void setCookieTicket(HttpServletRequest request,HttpServletResponse response,String sid,int cookieSecond) throws Exception;
    void exit(ActionSupport action) throws Exception;
    void destroy();
}